package com.ruihu.admin.module.business.tasknode.domain.vo;

import com.ruihu.admin.module.business.tasknode.domain.dto.NodeInstProcessDefectDTO;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;

/**
 *  [  ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c) 瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date  2023-02-22 11:44:41
 * @since JDK1.8
 */

@Data
public class NodeInstProcessDefectVO {

    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("子任务ID")
    private Long subTaskId;

    @ApiModelProperty("任务节点实例ID")
    private Long taskNodeInstId;

    @ApiModelProperty("表单元素关联ID")
    private Long processRelationId;

    @ApiModelProperty("缺陷类型ID")
    private Long defectTypeId;

    @ApiModelProperty("缺陷类型名称")
    private String defectName;

    @ApiModelProperty("创建人ID")
    private Long createBy;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("更新人ID")
    private Long updateBy;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;


    public static NodeInstProcessDefectVO convertToNodeInstProcessDefectVO(NodeInstProcessDefectDTO dto) {
        if (dto == null){
            return null;
        }
        NodeInstProcessDefectVO vo = new NodeInstProcessDefectVO();
        vo.setId(dto.getId());
        vo.setSubTaskId(dto.getSubTaskId());
        vo.setTaskNodeInstId(dto.getTaskNodeInstId());
        vo.setProcessRelationId(dto.getProcessRelationId());
        vo.setDefectTypeId(dto.getDefectTypeId());
        vo.setDefectName(dto.getDefectName());
        vo.setCreateTime(dto.getCreateTime());
        vo.setUpdateTime(dto.getUpdateTime());

        return vo;
    }
}
